import { IRoute } from "umi"

export interface IRouteWithBreambItem extends IRoute {
  type?: number | string;
  meta?: {
    [key: string]: unknown;
  };
  routes?: IRouteWithBreambItem[];
}

const routes: IRouteWithBreambItem[] = [
  /*
   暂时没有面包屑 不用管 
   hideChildrenInMenu: true,// 隐藏子菜单
   hideInMenu: true, // 隐藏自己和子菜单
   hideInBreadcrumb: true, // 在面包屑中隐藏
  */

  { type: 404, path: "/404", component: "@/pages/404" },

  {
    path: "/login",
    name: "登录",
    title: "登录",
    meta: { key: 324234 },
    component: "@/pages/login",
  },

  {
    path: "/",
    title: "首页",
    name: "首页",
    component: "@/layouts/index",
    routes: [
      {
        path: "/index",
        name: "首页",
        title: "首页",
        meta: { key: 324234, icon: "HomeOutlined" },
        component: "@/pages/index/index",
      },
      {
        path: "/consultationManagement",
        name: "会诊管理",
        title: "会诊管理",
        meta: { key: 324234, icon: "AppstoreOutlined" },
        component: "@/pages/consultationManagement/",
        routes: [
          {
            path: "/consultationManagement", // 如果发现左侧菜单没点亮，加上2级路径
            name: "会诊管理",
            title: "会诊管理",
            meta: { key: 324234 },
            component: "@/pages/consultationManagement/consultation",
          },
          {
            path: "/consultationManagement/consultationDetail",
            name: "会诊详情",
            title: "会诊详情",
            meta: { key: 324234 },
            component: "@/pages/consultationManagement/consultationDetail",
          },
          { type: 404, component: "@/pages/404" },
        ],
      },

      {
        path: "/patientManagement",
        name: "患者管理",
        title: "患者管理",
        meta: { key: 324234, icon: "UserOutlined" },
        component: "@/pages/patientManagement/",
        routes: [
          {
            path: "/patientManagement",
            name: "患者管理",
            title: "患者管理",
            meta: { key: 324234 },
            component: "@/pages/patientManagement/patient",
          },
          {
            path: "/patientManagement/hospitalizedInfo",
            name: "全息视图",
            title: "全息视图",
            meta: { key: 324234 },
            component: "@/pages/hospitalizedInfo/index",
          },
          {
            path: "/patientManagement/addAndEditPatient",
            name: "新增患者",
            title: "新增患者",
            meta: { key: 324234 },
            component: "@/pages/patientManagement/addAndEditPatient",
          },
          //
          { type: 404, component: "@/pages/404" },
        ],
      },

      {
        path: "/consultationTeam",
        name: "会诊小组",
        title: "会诊小组",
        meta: { key: 324234, icon: "UsergroupAddOutlined" },
        component: "@/pages/consultationTeam/",
        routes: [
          {
            path: "/consultationTeam",
            name: "会诊小组",
            title: "会诊小组",
            meta: { key: 324234 },
            component: "@/pages/consultationTeam/consultation",
          },
          {
            path: "/consultationTeam/teamMember",
            name: "小组成员",
            title: "小组成员",
            meta: { key: 324234 },
            component: "@/pages/consultationTeam/teamMember/teamMember",
          },
          {
            path: "/consultationTeam/newTeam",
            name: "新建小组",
            title: "新建小组",
            meta: { key: 324234 },
            component: "@/pages/consultationTeam/newTeam/newTeam",
          },

          { type: 404, component: "@/pages/404" },
        ],
      },

      // 系统设置
      {
        path: "/system",
        name: "系统设置",
        title: "系统设置",
        meta: { key: 1123456, icon: "SettingOutlined" },
        breadcrumb: "系统设置",
        component: "@/pages/system/",
        routes: [
          {
            path: "/system/departmentManagement",
            name: "科室管理",
            title: "科室管理",
            meta: { key: 1123456 },
            component: "@/pages/system/departmentManagement/departmentManagement",
          },
          /* 暂时注释 {
            path: "/system/hospitalManagement",
            name: "医院管理",
            title: "医院管理",
            meta: { key: 1123456 },
            component: "@/pages/system/hospitalManagement/hospitalManagement",
          }, */
          {
            path: "/system/characterManagement",
            name: "角色管理",
            title: "角色管理",
            meta: { key: 1123456 },
            component: "@/pages/system/characterManagement/characterManagement",
          },
          {
            path: "/system/userManagement",
            name: "用户管理",
            title: "用户管理",
            meta: { key: 1123456 },
            component: "@/pages/system/userManagement/userManagement",
          },
          { path: "/system", redirect: "/system/departmentManagement/departmentManagement" },
          { type: 404, component: "@/pages/404" },
        ],
      },
      { path: "/", redirect: "/index" },
      { type: 404, component: "@/pages/404" },
    ],
  },

  { type: 404, component: "@/pages/404" },
]

export default routes
